package com.hdj.chapter11;

/**
 * 〈一句话功能简述〉<br>
 *
 * @author hedajiang
 * @create 2017/12/14
 * @since 1.0.0
 */
public class CompositeTest {
    public static void main(String[] args) {
        Tree tree = new Tree("中國");
        TreeNode nodeB = new TreeNode("山西");
        TreeNode nodeC = new TreeNode("北京");

        nodeB.addChildNode(nodeC);
        tree.getRoot().addChildNode(nodeB);
        System.out.println(tree);

        System.out.println(tree.getRoot().getChildNodes());
    }

}